import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Index from "../pages/Index";
//1. 导入页面
import Goods from "../pages/goods/Goods";
import Specification from "../pages/goods/Specification";
import Brand from "../pages/goods/Brand";
import Category from "../pages/goods/Category";

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'Index',
    component: Index,
    children:[
        // 2.配置子路由
      {
        path:'/brand',
        name:'Brand',
        component:Brand
      },
      {
        path:'/category',
        name:'Category',
        component:Category
      },
      {
        path:'/list',
        name:'Goods',
        component:Goods
      },
      {
        path:'/specification',
        name:'Specification',
        component:Specification
      },
    ]
  },
];

const router = new VueRouter({
  routes
});

export default router
